<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('yp','center_header'); ?>
<div id="main">
<?php include template("yp","center_left"); ?>
<?php if($action=='add') { ?>
<div id="right">
<form action="<?php echo URL;?>" method="post" name="myform"  enctype="multipart/form-data" >
<table cellpadding="0" cellspacing="1" class="table_form">
<caption>发布新闻</caption>
    <?php if(is_array($forminfos)) foreach($forminfos AS $field => $info) { ?>
<tr id="<?php echo $field;?>_id"> 
      <th width="20%"> <?php if($info['star']) { ?> <font color="red">*</font><?php } ?> <strong><?php echo $info['name'];?></strong><br />
  <?php echo $info['tips'];?>
  </th>
      <td><?php echo $info['form'];?> </td>
    </tr>
<?php } ?>
    <tr> 
      <td></td>
      <td>
  <input type="hidden" name="forward" value="?file=news&action=add">
  <input type="submit" name="dosubmit" value=" 立刻发布 "> 
  </td>
    </tr>
</table>
</form>
</div>
<?php } elseif ($action=='edit') { ?>
<div id="right">
<form action="<?php echo URL;?>" method="post" name="myform"  enctype="multipart/form-data" >
<table cellpadding="0" cellspacing="1" class="table_form">
<caption>修改新闻</caption>
    <?php if(is_array($forminfos)) foreach($forminfos AS $field => $info) { ?>
<tr> 
      <th width="20%"> <?php if($info['star']) { ?> <font color="red">*</font><?php } ?> <strong><?php echo $info['name'];?></strong><br />
  <?php echo $info['tips'];?>
  </th>
      <td><?php echo $info['form'];?> </td>
    </tr>
<?php } ?>
    <tr> 
      <td></td>
      <td> 
  <input type="hidden" name="forward" value="<?php echo $forward;?>"> 
  <input type="submit" name="dosubmit" value=" 确定修改 "> 
  </td>
    </tr>
</table>
</form>
</div>
<?php } else { ?>
  <div id="right">
<table cellpadding="0" cellspacing="1" class="table_list">
  <caption>管理新闻</caption>
  <tr>
<th>标题</th>
<th width="50">点击</th>
<th width="50">状态</th>
<th width="110">更新时间</th>
<th width="40">操作</th>
  </tr>
<?php if(is_array($infos)) foreach($infos AS $info) { ?>
<?php $r = $c->get_count($info['id']);?>
<tr>
<td class="align_left"><a href="<?php echo show_url('news',$info[id]);?>" target="_blank" title="<?php echo $info['title'];?>"><?php echo $info['title'];?></a></td>
<td><?php echo $r['hits'];?></td>
<td><?php if($info[status]==99) { ?><font color=#009900>审核通过</font><?php } elseif ($info[status]==1) { ?><font color=#FF9900>待审核</font><?php } ?></td>
<td><?php echo date('Y-m-d H:i',$info[inputtime]);?></td>
<td><a href="<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=edit&id=<?php echo $info['id'];?>"><img src="yp/images/edit.gif" alt="修改"></a> <a href="javascript:confirmurl('<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=delete&id=<?php echo $info['id'];?>','确认删除此信息吗？')"><img src="yp/images/delete.gif" alt="删除"></td>
</tr>
<?php } ?>
</table>
<div id="pages"><?php echo $pages;?></div>
<table cellpadding="0" cellspacing="1" class="table_info">
  <caption>
  提示信息
  </caption>
  <tr>
<td> 您当前的级别为：<?php echo $GROUP[$_groupid];?> 
<br/>
</td>
  </tr>
</table>
  </div>
<?php } ?>
</div>
<div class="clear"></div>
<?php include template('phpcms','footer'); ?>
<SCRIPT LANGUAGE="JavaScript">
<!--
$().ready(function() {
  $('form').checkForm(1);
});
function buy_tid(typeid)
{
if(typeid==2)
{
$("#thumb_id").css('display','none');
$("#price_id").css('display','none');

}
else
{
$("#thumb_id").css('display','');
$("#price_id").css('display','');
}

}
//-->
</SCRIPT>
<script type="text/javascript" src="images/js/form.js"></script>
<script type="text/javascript" src="images/js/validator.js"></script>